<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6 lt8"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7 lt8"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8 lt8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
    <head>
        <title>Kai Pro系统</title>
        <%
			String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ request.getContextPath() + "/";
		%>
        <base href="<%=basePath%>">
        
        <link rel="shortcut icon" href="../favicon.ico"> 
        <link rel="stylesheet" type="text/css" href="<%=basePath%>css/demo.css" />
        <link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css" />
		<link rel="stylesheet" type="text/css" href="<%=basePath%>css/animate-custom.css" />
		<script src="<%=basePath%>plugin/jquery-easyui-1.4.3/jquery.min.js"
		type="text/javascript" charset="utf-8"></script>
		<script
		src="<%=basePath%>plugin/jquery-easyui-1.4.3/jquery.easyui.min.js"
		type="text/javascript" charset="utf-8"></script>
		<script
		src="<%=basePath%>plugin/jquery-easyui-1.4.3/extend.js"
		type="text/javascript" charset="utf-8"></script>	
	
		<link
		href="<%=basePath%>plugin/jquery-easyui-1.4.3/themes/default/easyui.css"
		rel="stylesheet" type="text/css" />
		<link href="<%=basePath%>plugin/jquery-easyui-1.4.3/themes/icon.css"
		rel="stylesheet" type="text/css" />
		<link href="<%=basePath%>plugin/jquery-easyui-1.4.3/demo/demo.css"
		rel="stylesheet" type="text/css" />
		<script
		src="<%=basePath%>plugin/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"
		type="text/javascript" charset="utf-8"></script>
    </head>
    <body>
        <div class="container">
            <!-- Codrops top bar -->
            <div class="codrops-top">
             

            </div><!--/ Codrops top bar -->
            <header>
                <h1>Kai Pro&nbsp;系统</h1>
				<nav class="codrops-demos">

				</nav>
            </header>
            <section>				
                <div id="container_demo" >
                    <!-- hidden anchor to stop jump http://www.css3create.com/Astuce-Empecher-le-scroll-avec-l-utilisation-de-target#wrap4  -->
                    <a class="hiddenanchor" id="toregister"></a>
                    <a class="hiddenanchor" id="tologin"></a>
                    <div id="wrapper">
                        <div id="login" class="animate form">
                            <form  id='login_form' autocomplete="on"> 
                                <h1>登录</h1> 
                                <p> 
                                    <label for="username" class="uname" data-icon="u" > 用户名</label><br/>
                                    <input class="easyui-validatebox textbox" type="text" data-options="required:true,missingMessage:'请输入用户名'" id="login_name" name="login_name" />
                                </p>
                                <p> 
                                    <label for="password" class="youpasswd" data-icon="p"> 密码 </label><br/>
                                    <input id="password"class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入密码'"  name="login_password"  type="password"  /> 
                                </p>
                                <p class="keeplogin"> 
                                <br>
<!-- 									<input type="checkbox" name="loginkeeping" id="loginkeeping" value="loginkeeping" />  -->
<!-- 									<label for="loginkeeping">记住我</label> -->
								</p>
                                <p class="login button"> 
                                    <input type="button" id="customer_login" value="客户登录" /> 
                                    <input type="button" id="admin_login" value="管理员登录" /> 
								</p>
                                <p class="change_link">
									
									<a href='<%=basePath%>login/registerPage'  class="to_register">点击注册</a>
								</p>
                            </form>
                        </div>
                    </div>
                </div>  
            </section>
        </div>
    </body>
    <script type="text/javascript">
    /**管理员登录按钮*/
	$("#admin_login").click(function(){
			$("#login_form").form('submit',{
					url : 'login/admin/validate.do',
					onSubmit : function() {//发送前操作    
						var isValid = $(this).form('validate');
							return isValid; // 返回false终止表单提交
					},
					success : function(data) {
						var data = eval('(' + data + ')');
							if (data.success == true) {
								window.location.href = '<%=basePath%>login/admin/home/index';
								//location.replace(sybp() + '/login/admin/home/index');
							} else {
								$.messager.alert('警告','<strong><center>'+ data.msg+ '</center></strong>');
							}
						}
						});
					});
	/**客户登录按钮*/
	$("#customer_login").click(function(){
		$("#login_form").form('submit',{
				url : 'login/customer/validate.do',
				onSubmit : function() {//发送前操作    
					var isValid = $(this).form('validate');
					return isValid; // 返回false终止表单提交
				},
				success : function(data) {
					var data = eval('(' + data +')');
					if (data.success == true) {
						window.location.href = '<%=basePath%>login/customer/home/index';
					} else {
						$.messager.alert('警告','<strong><center>'+ data.msg+ '</center></strong>');
					}
				}
				});
			});
</script>
</html>